@extends('layouts._app')
@section('content')
    <body>
    <div class="layui-tab page-content-wrap">
        <div class="layui-form-item">
            <div class="layui-inline tool-btn">
                <a class="layui-btn layui-btn-small layui-btn-primary" id='email-refresh-btn'
                   href="{{route('system.format.index')}}" data-title='刷新'>
                    <i class="layui-icon">&#x1002;</i>
                </a>
            </div>
        </div>
        <ul class="layui-tab-title">
            <li class="layui-this">图片</li>
            <li>文件</li>
            <li>文本</li>
        </ul>
        <div class="layui-tab-content">
            @include('layouts._flash')

            <div class="layui-tab-item layui-show">
                {!! Form::open(['route' => ['system.format.update',$format->id],'class'=>'layui-form','style'=>'width: 90%;padding-top: 20px;','method'=>'put']) !!}
                {!! Form::hidden('status','1') !!}
                <div class="layui-form-item">
                    {!! Form::label('','图片格式：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::textarea('picture',"{$format->picture}",['class'=>'layui-textarea','style'=>'height: -webkit-fill-available;']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','限制类型：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        <select name="picture_cate" id="">
                            @foreach(config('image.size') as $key=>$value)
                                <option value="{{$key}}"
                                        @if($key == $format->picture_cate) selected @endif >{{$value}}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','限制大小：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::number('picture_size',"{$format->picture_size}",['class'=>'layui-input']) !!}
                    </div>
                </div>

                <div class="layui-form-item">
                    <p style="color:red">上传格式多个请用英文逗号分开，单个后面不要逗号 ： `,`</p>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        {!! Form::submit('立即提交',['class'=>'layui-btn layui-btn-normal','lay-filter'=>'siteInfo','lay-submit']) !!}
                    </div>
                </div>
                {!! Form::close() !!}

            </div>
            <div class="layui-tab-item">
                {!! Form::open(['route' => ['system.format.update',$format->id],'class'=>'layui-form','style'=>'width: 90%;padding-top: 20px;','method'=>'put']) !!}
                {!! Form::hidden('status','2') !!}
                <div class="layui-form-item">
                    {!! Form::label('','文本格式：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::textarea('file',"{$format->file}",['class'=>'layui-textarea','style'=>'height: -webkit-fill-available;']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','限制类型：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        <select name="file_cate" id="">
                            @foreach(config('image.size') as $key=>$value)
                                <option @if($key == $format->file_cate) selected
                                        @endif value="{{$key}}">{{$value}}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','限制大小：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::number('file_size',"{$format->file_size}",['class'=>'layui-input']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    <p style="color:red">上传格式多个请用英文逗号分开，单个后面不要逗号 ： `,`</p>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        {!! Form::submit('立即提交',['class'=>'layui-btn layui-btn-normal','lay-filter'=>'siteInfo','lay-submit']) !!}
                    </div>
                </div>
                {!! Form::close() !!}

            </div>
            <div class="layui-tab-item">
                {!! Form::open(['route' => ['system.format.update',$format->id],'class'=>'layui-form','style'=>'width: 90%;padding-top: 20px;','method'=>'put']) !!}
                {!! Form::hidden('status','3') !!}
                <div class="layui-form-item">
                    {!! Form::label('','文本格式：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::textarea('text',"{$format->text}",['class'=>'layui-textarea','style'=>'height: -webkit-fill-available;']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','限制类型：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        <select name="text_cate" id="">
                            @foreach(config('image.size') as $key=>$value)
                                <option
                                    @if($key == $format->text_cate) selected
                                    @endif value="{{$key}}">{{$value}}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','限制大小：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::number('text_size',"{$format->text_size}",['class'=>'layui-input']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    <p style="color:red">上传格式多个请用英文逗号分开，单个后面不要逗号 ： `,`</p>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        {!! Form::submit('立即提交',['class'=>'layui-btn layui-btn-normal','lay-filter'=>'siteInfo','lay-submit']) !!}
                    </div>
                </div>
                {!! Form::close() !!}
            </div>

        </div>
    </div>
    <script src="{{asset('static/admin/layui/layui.js')}}" type="text/javascript" charset="utf-8"></script>
    <script src="{{asset('js/jquery.min.js')}}" type="text/javascript" charset="utf-8"></script>
    <script>
        layui.use(['form', 'element'], function () {
            var form = layui.form();
            var element = layui.element();
            var textarea = $('textarea');
            textarea.scrollTop(textarea[0].scrollHeight);
            form.render();
            form.on('submit(siteInfo)', function (data) {
            });
            form.on('submit(seoInfo)', function (data) {
            });
            form.on('submit(emailInfo)', function (data) {
            });
        });
    </script>
    </body>
@endsection
